package com.netintech.intelligenceInterface.iflytek.controller;

import com.netintech.intelligenceInterface.iflytek.domain.audioPretreatment.AudioPretreatmentParam;
import com.netintech.intelligenceInterface.iflytek.util.RestTemplateUtil;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.Collections;
import java.util.Map;

import static com.netintech.intelligenceInterface.common.StaticBean.URL1;
import static com.netintech.intelligenceInterface.iflytek.domain.IFlyTekKey.API_KEY;
import static com.netintech.intelligenceInterface.iflytek.domain.IFlyTekKey.API_SECRET;

/**
 * @author lining
 * @date 2021/4/28 9:04
 * 语音预处理 接口
 */
@RestController
public class AudioPretreatmentController {

    /**
     * 语音预处理接口路径
     */
    private static final String AUDIO_PRETREATMENT_URL = "/tuling/mlv/v2/vspp/do";

    @PostMapping("audioPretreatment")
    public String audioPretreatment(@RequestBody AudioPretreatmentParam param) {
        String url = URL1 + AUDIO_PRETREATMENT_URL;
        return RestTemplateUtil.getRestTemplateResult(url, param);
    }

    @PostMapping("/test/audioPretreatment")
    public String audioPretreatmentTest(@RequestBody AudioPretreatmentParam param) {
        String url = URL1 + AUDIO_PRETREATMENT_URL;
        return RestTemplateUtil.getRestTemplateResult(url, param);
    }
}
